package cn.gjxblog.config;

import cn.gjxblog.interceptor.HttpBasicAuthorizeInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import javax.annotation.Resource;

/**
 * @author gjx
 * @version v1.0
 * @Description
 * @date 2018/12/11 16:34
 */
//@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

    @Resource
    private HttpBasicAuthorizeInterceptor httpBasicAuthorizeInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(httpBasicAuthorizeInterceptor).addPathPatterns("/user/**");
        super.addInterceptors(registry);
    }
}
